export type MainResponseType<T extends object | string> = {
  "code": number
  "msg": string,
  "data": T
}

// 邀请链接类型
export type productRewardType = Record<grade, Array<string>>
export type describeValType = Record<grade, string>
export type inviteType = {
  invite_url: string,
  product_reward: productRewardType,
  describe_val: describeValType
}
// 任务类型
export type taskListItemType = {
  id: number,
  user_id: number,
  task_type: number,
  task_id: number,
  date_val: string,
  target_number: number,
  reward_money: string,
  reach_num: number,
  state: number,
  creat_time: number,
  title: string,
  detail: string,
  day_get: number,
  max_buy_num: number,
  purchased_num: number
}
// 产品类型
export type productItemType = {
  id: number,
  level: number,
  price: string,
  state: 1 | 2 | 3,
  inventory: number,
  sold_quantity: number,
  daily_return: string,
  profitable_days: string,
  total_revenue: number,
  cover: string,
  title: string,
  residue_num: number
  day_get: string
  max_buy_num: number,
  purchased_num: number
}
// 银行卡账号
export type cardItemType = {
  id: number,
  user_id: number,
  ifsc: string,
  name: string,
  card: string,
  is_del: number,
  create_time: number,
}
// 充值通道类型
export type paymentChannelItemType = {
  id: number,
  name: string,
  recharge_max: string,
  recharge_min: string,
}
// 用户购买记录类型
export type buyItemType = {
  product_title: string,
  product_type: number,
  cover: string,
  id: number,
  release_status: number,
  order_amount: string,
  buy_num: number,
  total_day: number,
  total_reward: string,
  total_nums: string,
  day_get: string,
  already_get: string,
  add_time: string,
  expiration_time: string,
  level: number
}
export type buyListType<T> = {
  page_on: string,
  total_page: number
  list_data: T
}

// 账户流水类型
export type accountRecordType = {
  add_time: string,
  adds: string,
  desc: string,
}
export type accountDataType = {
  page_on: string,
  total_page: number,
  recharge_balance: number,
  withdraw_balance: number,
  list_data: accountRecordType[]
}
// 用户充值记录
export type rechargeItem = {
  recharge_id: number,
  order_sn: string,
  amount: number,
  add_time: string,
  draw_status: number,
  english_name: string,
}
// 我的团队
type grade = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
export type myTeamItemType = {
  data: Array<myTeamDataType>,
  num: number,
  total_money: number
}
type myTeamDataType = {
  user_id: number,
  regdate: number,
  is_activation: number,
  regdate_date: number,
}
// export type myTeamRepType = {
//   [key in grade]: myTeamItemType
// }
export type myTeamRepType = {
  [key in string]: myTeamItemType
}
// 系统参数
export type configType = {
  official_telegram_url: string,
  telegram_url: string,
  download_url: string,
  whatsapp_url: string
  withdrawal_time: string,
  withdrawal_min_money: string,
  withdrawal_max_money: string,
  withdrawal_handl_fee_rate: string,
  withdrawal_num: string,
  share_activation_reward_money: number
  usdt_withdrawal_time: string
  usdt_withdrawal_min_money: string
  usdt_withdrawal_max_money: string
  usdt_withdrawal_handl_fee_rate: string
  usdt_withdrawal_num: string
  usdt_price: string
}
// 佣金记录
export type commissionRecordsItemType = {
  money: number,
  invite_level: number,
  product_type: number,
  type: number,
  creat_time: string
  source: string
}
// 奖励记录
export type rewardRecordsItemType = {
  id: number,
  user_id: number,
  type: number,
  entry: 1 | 2,
  money: number,
  creat_time: string,
  flow_log: number,
  type_name: string,
}
// 盈利记录
export type profitRecordItemType = {
  id: number,
  user_id: number,
  order_id: number,
  money: number,
  creat_time: string,
  title: string,
}
//热销
export type hotSalesItemType = {
  id: number,
  cover: string,
  product_type: number
}
// 用户等级页面数据-vip
type levelListItemType = {
  id: number,
  is_del: number,
  level: number,
  name: string,
  buy_record: number,
  ztlevel_num: number,
  achieved: number,
}
export type levelDataType = {
  user_level: number,
  performance: number,
  level_data: levelListItemType[]
}

export type announceType = {
  id: number
  title: string
  cover: string
  addtime: string
  content: string
}

// 留言板列表
export type messageListItemType = {
  id: number,
  user_id: number,
  entry: number,
  state: number,
  content_val: string
  reward_num: string
  creat_time: string
  nickname: string
  mobile: string
  avatar: string
  picture_val: Array<string>
}
export type taskListType = MainResponseType<taskListItemType[]>
export type productType = MainResponseType<productItemType[]>
export type cardListType = MainResponseType<cardItemType[]>
export type paymentChannelType = MainResponseType<paymentChannelItemType[]>
export type buyOrderListType = MainResponseType<buyListType<buyItemType[]>>
export type accountListType = MainResponseType<accountDataType>
export type rechargeType = MainResponseType<buyListType<rechargeItem[]>>
export type myTeamType = MainResponseType<myTeamRepType>
export type commissionRecordsType = MainResponseType<buyListType<commissionRecordsItemType[]>>
export type rewardRecordsType = MainResponseType<buyListType<rewardRecordsItemType[]> & { total_money: string }>
export type profitRecordType = MainResponseType<buyListType<profitRecordItemType[]>>
export type hotSalesType = MainResponseType<productItemType[]>
export type vipType = MainResponseType<levelDataType>
export type inviteDataType = MainResponseType<inviteType>